using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyObjCtrl : MonoBehaviour
{

    private string age = string.Empty;
    private string name = string.Empty;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    private void OnGUI()
    {
        if (GUILayout.Button("Print"))
        {
            var data = Resources.Load<MySciptObj>("friends");
            data.Print();
        }

        name = GUILayout.TextField(name);
        age = GUILayout.TextField(age);
        if (GUILayout.Button("Save"))
        {
            var data = Resources.Load<MySciptObj>("friends");
            data.Save(name, int.Parse(age));
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
